import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains

from selenium.webdriver.support.ui import WebDriverWait as Ec
from selenium.webdriver.support.wait import WebDriverWait


class Base():

    def __init__(self,url):
        self.driver = url,

    #封装现实显示等待
    def find_element(self,loc):
        try:
            WebDriverWait(self.driver,20,0.5).until((Ec.until_not(*loc)))
        except Exception as e:
            print()
    #封装点击事件
    def click(self,loc):
        self.driver.find_element(*loc).click()

    #封装书写
    def send_keys(self,loc,info):
        self.driver.find_element(*loc).send_keys(info)
